/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.baicaix.chat;

import org.baicaix.chat.controllers.StartUpCommand;
import org.puremvc.java.patterns.facade.Facade;

/**
 *
 * @author baicaix
 */
public class ChatMainFacade extends Facade {

    private static ChatMainFacade _instance;

    private ChatMainFacade() {
    }

    public static ChatMainFacade getInstance() {
        if(_instance == null) {
            _instance = new ChatMainFacade();
        }
        return _instance;
    }

    @Override
    protected void initializeController() {
        super.initializeController();
        //注册初始化Command
        registerCommand(ChatConstants.START_UP, StartUpCommand.class);
    }

    public void startUp() {
        //Call 初始化 Command
        sendNotification(ChatConstants.START_UP, this, null);
        //应该也可以使用这种方式
        //notifyObservers(null);
    }
}
